/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.lucava.boatskeeper.server.handler.boat;

import java.util.ArrayList;
import net.customware.gwt.dispatch.server.ActionHandler;
import net.customware.gwt.dispatch.server.ExecutionContext;
import net.customware.gwt.dispatch.shared.ActionException;
import org.lucava.boatskeeper.server.MockBoatDao;
import org.lucava.boatskeeper.shared.Boat;
import org.lucava.boatskeeper.shared.rpc.boat.GetBoats;
import org.lucava.boatskeeper.shared.rpc.boat.GetBoatsResult;

/**
 *
 * @author glenn
 */
public class GetBoatsHandler implements ActionHandler<GetBoats, GetBoatsResult> {

    @Override
    public Class<GetBoats> getActionType() {
        return GetBoats.class;
    }

    @Override
    public GetBoatsResult execute(GetBoats a, ExecutionContext ec) throws ActionException {
        
        GetBoatsResult getBoatsResult = new GetBoatsResult(MockBoatDao.getAll());

        return getBoatsResult;
    }

    @Override
    public void rollback(GetBoats a, GetBoatsResult r, ExecutionContext ec) throws ActionException {
    }
}
